package demo;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class HelloWord {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("test.txt");
        String s = "一袋米要扛几楼";
        fos.write(s.getBytes(StandardCharsets.UTF_8));
        String s2 = "主线上写入的内容！！！";
        fos.write(s2.getBytes(StandardCharsets.UTF_8));
        String s1 = "分支上写入的内容！！！";
        fos.write(s1.getBytes(StandardCharsets.UTF_8));
        String s3 = "分支上又写入了新内容！！！";
        fos.write(s3.getBytes(StandardCharsets.UTF_8));
        System.out.println("写出完毕");
        fos.close();
    }
}
